package com.andatsoft.laisim.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ViewFlipper;

public class MyViewFlipper extends ViewFlipper {

	public interface IFlipperIndexChanged {
		public void onIndexChanged(int index);
	}

	private IFlipperIndexChanged mIViewFlipperChanged;

	public MyViewFlipper(Context context) {
		super(context);
	}

	public MyViewFlipper(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public void setOnFlipperIndexChanged(IFlipperIndexChanged event) {
		this.mIViewFlipperChanged = event;
	}

	@Override
	public void setDisplayedChild(int whichChild) {
		super.setDisplayedChild(whichChild);
		if (mIViewFlipperChanged != null)
			mIViewFlipperChanged.onIndexChanged(whichChild);
	}

}
